package com.itestor.iptv.modules.alert.dao;

import org.hibernate.Query;

import com.itestor.iptv.global.dao.GenericHibernateDao;
import com.itestor.iptv.modules.alert.domain.RobotLog;

/**
 * @author Mr.li
 */
public class TbRobotLogDao extends GenericHibernateDao<RobotLog, Long> {

    /**
     * 清除告警
     * @param entityId
     */
    public void delete(Long entityId) {
        String hsql_str = "update RobotLog t set t.recycle=1 where t.idRobotLog=:idRobotLog";
        Query query = getHibernateSession().createQuery(hsql_str);
        query.setParameter("idRobotLog", entityId);
        query.executeUpdate();

    }

    /**
     * 确认告警
     * @param entityId
     */
    public void confirm(Long entityId) {
        String hsql_str = "update RobotLog t set t.confirm=1 where t.idRobotLog=:idRobotLog";
        Query query = getHibernateSession().createQuery(hsql_str);
        query.setParameter("idRobotLog", entityId);
        query.executeUpdate();

    }

}